<template>
  <!-- 商品分类 -->
  <div class="Commodity-ification-Wrap">
    <el-table :data="tableData" style="width: 100%" max-height="650" @selection-change="handleSelectionChange">
      <el-table-column fixed prop="date" label="日期" width="150" type="selection">
      </el-table-column>
      <el-table-column prop="gc_id" label="id" width="180">
      </el-table-column>
      <el-table-column prop="gc_name" label="名称" width="180">
      </el-table-column>
      <el-table-column prop="gc_taxi" label="地址" width="240">
      </el-table-column>
      <el-table-column fixed="right" label="操作" width="120">
        <template slot-scope="scope">
          <el-button @click.native.prevent="deleteRow(scope.$index, tableData)" type="text" size="small">移除</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
  export default {
	mounted(){
		let _this = this
		this.$http({
			method: "get",
			url: "goodscat"
		}).then(function(response) {
			_this.tableData = response.data
			console.log(response);
		}).catch(function(error) {
			console.log(error);
		});
	},
    methods: {
      deleteRow(index, rows) {
        rows.splice(index, 1);
	  },
	  handleSelectionChange(val) {
		this.multipleSelection = val;
		console.log(val)
      }
    },
    data() {
      return {
		multipleSelection:[],
        tableData: []
      };
    }
  };

</script>

<style>
.Commodity-ification-Wrap .el-table th{
	text-align: center
}

</style>
